package nowcoder.vivo1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int r = 0;
        while (sc.hasNextInt()){
            int tmp = sc.nextInt();
            int c = tmp/7;
            if(c*7 == tmp || String.valueOf(tmp).contains("7")){
                r++;
            }
        }
        System.out.println(r);
    }

}
